package com.xnyzc.lhy.common.penum.cms;

import com.xnyzc.lhy.common.penum.datascope.ESysDataScope;

/**
 * 司机信息管理枚举
 *
 * @author zhaolijie
 * @date 2019-08-23 14:23
 */
public enum EDriverType {

    //1：性別男
    sexMan(1, "男"),
    //2：性別女
    sexWoman(2, "女"),
    //3：性別保密
    sexSecrecy(3, "保密"),
    //4：性別未设置
    sexNotSet(4, "未设置"),

    loginAccountNoSet(0, "未设置"),

    //用戶状态，0：正常用户
    isBlockedNormal(0, "正常用户"),
    //用戶状态，1：黑名单用户
    isBlockedBlacklist(1, "黑名单用户"),
    //用戶状态，2：用户已注销
    isBlockedWriteOff(2, "用户已注销"),


    //身份证状态，0：未上传
    identityVerfiedNotUploaded(0, "未上传"),
    //身份证状态，1：待审核
    identityVerfiedCheckPending(1, "待审核"),
    //身份证状态，2：审核通过
    identityVerfiedAuditAndApproval(2, "审核通过"),
    //身份证状态，4：未上传
    identityVerfiedAuditFailure(4, "审核失败"),
    //身份证状态，5：未上传
    identityVerfiedIDCardExpires(5, "身份证过期"),

    //驾照状态：0未上传
    driveVerfiedNotUploaded(0, "未上传"),
    //驾照状态：1待审核
    driveVerfiedCheckPending(1, "待审核"),
    //驾照状态：2审核通过
    driveVerfiedAuditAndApproval(2, "审核通过"),
    //驾照状态：4审核失败
    driveVerfiedAuditFailure(4, "审核失败"),
    //驾照状态：5驾照过期
    driveVerfiedIDCardExpires(5, "驾照过期");

    /**
     * 查询性别
     * @param type
     * @return
     */
    public static EDriverType findSex(Integer type) {
        EDriverType eDriverType;
        switch (type) {
            case 1:
                eDriverType = EDriverType.sexMan;
                break;
            case 2:
                eDriverType = EDriverType.sexWoman;
                break;
            case 3:
                eDriverType = EDriverType.sexSecrecy;
                break;
            case 4:
                eDriverType = EDriverType.sexNotSet;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eDriverType;
    }

    /**
     * 查询用户状态
     * @param type
     * @return
     */
    public static EDriverType findIsBlocked(Integer type) {
        EDriverType eDriverType;
        switch (type) {
            case 0:
                eDriverType = EDriverType.isBlockedNormal;
                break;
            case 1:
                eDriverType = EDriverType.isBlockedBlacklist;
                break;
            case 2:
                eDriverType = EDriverType.isBlockedWriteOff;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eDriverType;
    }

    /**
     * 查询身份证状态
     * @param type
     * @return
     */
    public static EDriverType findIdentityVerfied(Integer type) {
        EDriverType eDriverType;
        switch (type) {
            case 0:
                eDriverType = EDriverType.identityVerfiedNotUploaded;
                break;
            case 1:
                eDriverType = EDriverType.identityVerfiedCheckPending;
                break;
            case 2:
                eDriverType = EDriverType.identityVerfiedAuditAndApproval;
                break;
            case 4:
                eDriverType = EDriverType.identityVerfiedAuditFailure;
                break;
            case 5:
                eDriverType = EDriverType.identityVerfiedIDCardExpires;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eDriverType;
    }


    /**
     * 查询驾驶证状态
     * @param type
     * @return
     */
    public static EDriverType findDriveVerfied(Integer type) {
        EDriverType eDriverType;
        switch (type) {
            case 0:
                eDriverType = EDriverType.driveVerfiedNotUploaded;
                break;
            case 1:
                eDriverType = EDriverType.driveVerfiedCheckPending;
                break;
            case 2:
                eDriverType = EDriverType.driveVerfiedAuditAndApproval;
                break;
            case 4:
                eDriverType = EDriverType.driveVerfiedAuditFailure;
                break;
            case 5:
                eDriverType = EDriverType.driveVerfiedIDCardExpires;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eDriverType;
    }


    private Integer value;
    private String desc;

    EDriverType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
